<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        :root {
            font-size: 2vw;
        }
        body>* {
            display: block;
            width: 100%;
            font-size: inherit;
        }
        body>:nth-child(1),body>:nth-child(3){
            height:calc(50vh - 2rem);
        }
    </style>
</head>
<body>
<textarea>
    {
        "className":"vc202101",
        "classNum":13,
        "isJava":true,
        "teacher": [
            {
                "name":"mis zhou",
                "couse":"java"
            },{
                "name":"miss li",
                "couse":"vue"
            }
        ],
        "students":[
            {
                "name":"张三",
                "brithdate":"2000-1-2",
                "result":[59,90,80,90]
            },
            {
                "name":"李四",
                "brithdate":"2002-1-2",
                "result":[79,70,80,90]
            },
            {
                "name":"王五",
                "brithdate":"2001-1-2",
                "result":[99,80,80,95]
            }

        ]

    }
</textarea>
<button>解析</button>
<textarea>

</textarea>
<script style="display: none;">
    let ts = document.querySelectorAll("textarea");
    let b = document.querySelector("button");
    b.onclick=function(){
        let text = ts[0].value;
        console.debug(text);
        let obj = JSON.parse(text);
        obj.d = new Date();
        console.debug(obj);
        let jsonStr = JSON.stringify(obj);
        console.debug(jsonStr);
        jsonStr = JSON.stringify(obj,null,"  ");
        ts[1].value = jsonStr;
    }

</script>
</body>
</html>